<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>字典目录管理</title>
    <#include "/common/link.ftl">

</head>
<body class="hold-transition skin-black sidebar-mini">
<div class="wrapper">
    <#include "/common/navbar.ftl">

    <#assign currentMenu="systemDictionary"/>

    <#include "/common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>字典目录管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <form class="form-inline" id="searchForm" action="/systemDictionary/list" method="post">
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                    <a href="#" class="btn btn-success btn-input" style="margin: 10px">
                        <span class="glyphicon glyphicon-plus"></span> 添加
                    </a>
                </form>
                <!--编写内容-->
                <div class="box-body table-responsive">
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>字典目录标题</th>
                                <th>字典目录编码</th>
                                <th>字典目录简介</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <script>
                            $(function () {
                                $('.btn-input').click(function () {
                                    $('#myModal').modal("show");
                                    var data = $(this).data("json");
                                    if (data){
                                        $('input[name="id"]').val(data.id);
                                        $('input[name="title"]').val(data.title);
                                        $('input[name="sn"]').val(data.sn);
                                        $('input[name="intro"]').val(data.intro);
                                    }else {
                                        $('input[name="id"]').val("");
                                        $('input[name="title"]').val("");
                                        $('input[name="sn"]').val("");
                                        $('input[name="intro"]').val("");
                                    }

                                })
                            });
                        </script>
                        <!-- Modal -->
                        <form action="/systemDictionary/saveOrUpdate" method="post" id="saveFrom">
                        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                        <h4 class="modal-title" id="myModalLabel">新增</h4>
                                    </div>
                                    <div class="modal-body">
                                        <input type="hidden" name="id">
                                            <div class="form-group">
                                                <label for="exampleInputText1">字典目录标题</label>
                                                <input type="text" name="title" class="form-control" id="exampleInputText1" placeholder="请输入字典目录标题">
                                            </div>
                                            <div class="form-group">
                                                <label for="exampleInputText2">字典目录编码</label>
                                                <input type="text" name="sn" class="form-control" id="exampleInputText2" placeholder="请输入字典目录编码">
                                            </div>
                                            <div class="form-group">
                                                <label for="exampleInputText3">字典目录简介</label>
                                                <input type="text" name="intro" class="form-control" id="exampleInputText3" placeholder="请输入字典目录简介">
                                            </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                        <button id="btn" type="submit" class="btn btn-primary">提交</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        </form>
                        <tbody>

                       <#list PageInfo.list as d>
                           <tr>
                               <td>${d.id}</td>
                               <td>${d.title}</td>
                               <td>${d.sn}</td>
                               <td>${d.intro}</td>
                               <td>
                                   <a href="#" class="btn btn-info btn-xs btn-input" data-json='${d}'>
                                       <span class="glyphicon glyphicon-pencil"></span> 编辑
                                   </a>
                               </td>
                           </tr>
                       </#list>
                        </tbody>
                    </table>
                    <#include "/common/page.ftl" >
                </div>
            </div>
        </section>
    </div>
    <#include "/common/footer.ftl" >
</div>

</body>
</html>
